//
//  ViewController.m
//  SXCollectionViewImageCirculatePlay
//
//  Created by 98linju on 2017/7/27.
//  Copyright © 2017年 98linju. All rights reserved.
//

#import "ViewController.h"
#import "UIImageView+WebCache.h"
#import "SXCollectionUnlimteImageScroll.h"
@interface ViewController (){
    NSArray *_netWorkImageArr;
}
@property (nonatomic,strong) UICollectionView *collectionView;
@property (nonatomic,strong) NSTimer *timer;
@property (nonatomic,weak) UIPageControl *pageControl;
@property (nonatomic,assign) NSInteger itemSelected;
@end

@implementation ViewController
static NSString *cellID = @"collectionViewCellID";
- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
   //设置网络图片
    [self setNetWorkScroll];
    //设置本地图片轮播
   // [self setLocalImageScroll];
    
}
- (void) setNetWorkScroll{
    _netWorkImageArr = @[@"http://98ljptmisc.oss-cn-shanghai.aliyuncs.com//Public/orderr/images/guang01.jpg",@"http://98ljptmisc.oss-cn-shanghai.aliyuncs.com//Public/orderr/images/guang02.jpg",@"http://dev98ljptmisc.oss-cn-shanghai.aliyuncs.com/uploads/Array/73bc74c051ad8832fe3988d5240e4168.png"];
    SXCollectionUnlimteImageScroll *scrollView = [[SXCollectionUnlimteImageScroll alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 200) netImageArr:_netWorkImageArr placeholderImage:nil delayTime:1.0 pageCurrenTincolor:nil pageTincolor:nil];
    scrollView.selectedItemBlock = ^(NSInteger index) {
        NSLog(@"%ld",(long)index);
    };
    [self.view addSubview:scrollView];
}
- (void) setLocalImageScroll{
    NSArray *localArr = @[@"image1.png",@"image3.png",@"image4.png",@"image2.png",@"image5.png"];
    SXCollectionUnlimteImageScroll *scrollView = [[SXCollectionUnlimteImageScroll alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 200) localImageArr:localArr delayTime:1.0 pageCurrenTincolor:[UIColor redColor] pageTincolor:[UIColor grayColor]];
    scrollView.selectedItemBlock = ^(NSInteger index) {
        NSLog(@"%ld",(long)index);
    };
    [self.view addSubview:scrollView];
}
@end
